/**
 * Title:		T03RectangleSpiral.java
 * Description: Test program for function definition
 * 
 * @version		1.0 May 2009
 * @author		Hidemitsu Izawa (hi2136@columbia.edu)
 */
import kfrog.Frog;
import kfrog.Pond;

public class T03RectangleSpiral {
	
	//function definition
	public static void rectangle(int length,Frog frog){
		frog.forward(length);
		frog.turnright(89);
	}
	
	public static void main(String args[]){
		/** pond */
		Pond pond = new Pond(400,400);//"pondsize" command in KFrog
		pond.setPondColor("WHITE");//"pondcolor" command in KFrog
		
		/** frog1 */
		Frog frog1 = new Frog(pond,1);//"new frog" command in KFrog
		frog1.frogcolor("BLUE");//"frogcolor" command in KFrog
		frog1.speed(5);//"speed" command in KFrog. 1:slow <-> 5:fast
		frog1.startdraw();//"startdraw" command in KFrog
		int l=1;
		while(l<200){//"while" command in KFrog
			rectangle(l,frog1); 
			l++;
		}
		Thread FROG1 = new Thread(frog1);/// end of "new frog"
		FROG1.start();/// end of "new frog"
	}
}
